<?php

namespace app\common\model;

use think\Model;

class Address extends Model
{
    // 表名,不含前缀
    protected $name = 'user_address';

    // 追加属性
//    protected $append = [
//        'full_address'
//    ];

    public function getFullAddressAttr($value, $data)
    {
        /*$province=Area::get($data['province'])?:[];
        $city=Area::get($data['city'])?:[];
        $county=Area::get($data['county'])?:[];

        return ($province?$province['name']:'')
            .($city?$city['name']:'')
            .($county?$county['name']:'')
            .$data['detail'];*/
        return $data['address'].$data['detail'];
    }
}
